-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Emotion] Convert EuiDataGrid gridStyle
s to Emotion (Part 3)
#8006
Conversation
5d04264
to
f65e427
Compare
gridStyle
s to Emotion (part 3)
6afaa83
to
d7d7e53
Compare
gridStyle
s to Emotion (part 3)gridStyle
s to Emotion (Part 3)
- unfortunately can't be as specific here, has to be applied to top level datagrid styles
- handle this at topmost grid level, I personally don't think it makes any sense to split it up by component when they affect each other - more files makes it harder to write/predict + clean up several CSS unsets by assuming lack of borders rather than presence of borders
- some fontSize/lineHeight tweaking required to stay the same as prod (due to changes Caroline made to euiFontSize) + improve Emotion className labeling
- we can now obtain cell padding sizes from dynamic themes, hooray
- pass `gridStyles` down through the body and to the rows so CSS can be a bit flatter, as those styles only concern those components + convert enzyme tests to RTL
+ remove unnecessary show footer toggle - it's the entire point of the demo, why would we disable it? + remove flex in favor of EuiSpacer
- grid borders and header/footer underline/overlines were conflicting with one another - borders on header/footer cells were adding extra height to the cells themselves (unlike regular row cells)
…utils - VRT stories should use minimal data still for screenshot simplicity + add 2 new stories with more customizable controls, which lists the nested props documentation for each nested config
- allows us to expand props documentation & use controls for `rowHeightsOptions` + add test for lineHeight
d7d7e53
to
92e6fd8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work on the conversion, you added some nice little code improvements and I didn't see any unexpected regression 🎉
And I really dig the storybook organization update 👏 I left a couple small questions, but nothing major.
packages/eui/src/components/datagrid/data_grid_styles.stories.tsx
Outdated
Show resolved
Hide resolved
+ remove `PRESERVED_FALSE_VALUE_PROPS` logic - we should let the defaultProps logic handle that instead and always show `false` props if they're non-defaults (testable on, e.g. `<EuiExpression uppercase={false} />`)
💚 Build Succeeded
History
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢 🐈⬛ Thanks for the updates, all looking good to me now 👍
`v95.10.1`⏩`v95.11.0` > [!note] > The bulk of this release is **EuiDataGrid**. The component has been fully converted to Emotion, and several UX changes have been made to data cell actions. We recommend QA testing any data grid(s) that have custom styles applied to them. _[Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_ --- ## [`v95.11.0`](https://github.com/elastic/eui/releases/v95.11.0) - Updated `EuiText`, `EuiTextColor`, and `EuiTextAlign` with a new `component` prop that allows changing the default rendered `<div>` wrapper to a `<span>` or `<p>` tag. ([#7993](elastic/eui#7993)) - Updated `EuiDataGrid`'s cell actions to always consistently be left-aligned, regardless of text content alignment ([#8011](elastic/eui#8011)) - Increased `EuiDataGrid`'s cell actions hover zone to reduce UX friction when mousing over from the grid cell to its actions ([#8011](elastic/eui#8011)) **Bug fixes** - Fixed `EuiPopover` to correctly inherit from `EuiProvider`'s `componentDefaults.EuiPortal.insert` ([#8003](elastic/eui#8003)) - Fixed push `EuiFlyoutResizable`s to not potentially block scrollbars on outside content ([#8010](elastic/eui#8010)) - Fixed an `EuiDataGrid` bug where the `setCellProps` callback passed by `renderCellValue` was not correctly applying custom `data-test-subj`s ([#8011](elastic/eui#8011)) **Accessibility** - Updated the `EuiBasicTable` actions button's `aria-label` by adding a reference to the current row ([#7994](elastic/eui#7994)) **CSS-in-JS conversions** - Converted `EuiDataGrid`'s toolbar controls to Emotion ([#7997](elastic/eui#7997)) - Removed `$euiDataGridPopoverMaxHeight` - Converted `EuiDataGrid` to Emotion ([#7998](elastic/eui#7998)) - Removed `$euiZDataGrid` - Removed `$euiZHeaderBelowDataGrid` - Converted `EuiDataGrid`'s `gridStyle`s to Emotion; Removed the following Sass variables and mixins: ([#8006](elastic/eui#8006)) - `$euiDataGridCellPaddingS` - `$euiDataGridCellPaddingM` - `$euiDataGridCellPaddingL` - `$euiDataGridVerticalBorder` - `$euiDataGridPrefix` - `$euiDataGridStyles` - `@euiDataGridSelector` - `@euiDataGridStyles` - Converted `EuiDataGrid`'s cell popover, actions, and focus outline to Emotion; Removed the following Sass variables and mixins: ([#8011](elastic/eui#8011)) - `$euiZDataGridCellPopover` - `@euiDataGridCellFocus` - Converted `EuiDataGrid`'s row, header, and footer cells to Emotion; Removed the following Sass variables and mixins: ([#8013](elastic/eui#8013)) - `$euiDataGridColumnResizerWidth` - `@euiDataGridRowCell` - `@euiDataGridHeaderCell` - `@euiDataGridFooterCell`
`v95.10.1`⏩`v95.11.0` > [!note] > The bulk of this release is **EuiDataGrid**. The component has been fully converted to Emotion, and several UX changes have been made to data cell actions. We recommend QA testing any data grid(s) that have custom styles applied to them. _[Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_ --- ## [`v95.11.0`](https://github.com/elastic/eui/releases/v95.11.0) - Updated `EuiText`, `EuiTextColor`, and `EuiTextAlign` with a new `component` prop that allows changing the default rendered `<div>` wrapper to a `<span>` or `<p>` tag. ([elastic#7993](elastic/eui#7993)) - Updated `EuiDataGrid`'s cell actions to always consistently be left-aligned, regardless of text content alignment ([elastic#8011](elastic/eui#8011)) - Increased `EuiDataGrid`'s cell actions hover zone to reduce UX friction when mousing over from the grid cell to its actions ([elastic#8011](elastic/eui#8011)) **Bug fixes** - Fixed `EuiPopover` to correctly inherit from `EuiProvider`'s `componentDefaults.EuiPortal.insert` ([elastic#8003](elastic/eui#8003)) - Fixed push `EuiFlyoutResizable`s to not potentially block scrollbars on outside content ([elastic#8010](elastic/eui#8010)) - Fixed an `EuiDataGrid` bug where the `setCellProps` callback passed by `renderCellValue` was not correctly applying custom `data-test-subj`s ([elastic#8011](elastic/eui#8011)) **Accessibility** - Updated the `EuiBasicTable` actions button's `aria-label` by adding a reference to the current row ([elastic#7994](elastic/eui#7994)) **CSS-in-JS conversions** - Converted `EuiDataGrid`'s toolbar controls to Emotion ([elastic#7997](elastic/eui#7997)) - Removed `$euiDataGridPopoverMaxHeight` - Converted `EuiDataGrid` to Emotion ([elastic#7998](elastic/eui#7998)) - Removed `$euiZDataGrid` - Removed `$euiZHeaderBelowDataGrid` - Converted `EuiDataGrid`'s `gridStyle`s to Emotion; Removed the following Sass variables and mixins: ([elastic#8006](elastic/eui#8006)) - `$euiDataGridCellPaddingS` - `$euiDataGridCellPaddingM` - `$euiDataGridCellPaddingL` - `$euiDataGridVerticalBorder` - `$euiDataGridPrefix` - `$euiDataGridStyles` - `@euiDataGridSelector` - `@euiDataGridStyles` - Converted `EuiDataGrid`'s cell popover, actions, and focus outline to Emotion; Removed the following Sass variables and mixins: ([elastic#8011](elastic/eui#8011)) - `$euiZDataGridCellPopover` - `@euiDataGridCellFocus` - Converted `EuiDataGrid`'s row, header, and footer cells to Emotion; Removed the following Sass variables and mixins: ([elastic#8013](elastic/eui#8013)) - `$euiDataGridColumnResizerWidth` - `@euiDataGridRowCell` - `@euiDataGridHeaderCell` - `@euiDataGridFooterCell` (cherry picked from commit 9bbb296)
# Backport This will backport the following commits from `main` to `8.x`: - [Upgrade EUI to v95.11.0 (#192756)](#192756) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cee Chen","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-23T22:45:19Z","message":"Upgrade EUI to v95.11.0 (#192756)\n\n`v95.10.1`⏩`v95.11.0`\r\n\r\n> [!note]\r\n> The bulk of this release is **EuiDataGrid**. The component has been\r\nfully converted to Emotion, and several UX changes have been made to\r\ndata cell actions. We recommend QA testing any data grid(s) that have\r\ncustom styles applied to them.\r\n\r\n_[Questions? Please see our Kibana upgrade\r\nFAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_\r\n\r\n---\r\n\r\n## [`v95.11.0`](https://github.com/elastic/eui/releases/v95.11.0)\r\n\r\n- Updated `EuiText`, `EuiTextColor`, and `EuiTextAlign` with a new\r\n`component` prop that allows changing the default rendered `<div>`\r\nwrapper to a `<span>` or `<p>` tag.\r\n([#7993](https://github.com/elastic/eui/pull/7993))\r\n- Updated `EuiDataGrid`'s cell actions to always consistently be\r\nleft-aligned, regardless of text content alignment\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n- Increased `EuiDataGrid`'s cell actions hover zone to reduce UX\r\nfriction when mousing over from the grid cell to its actions\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n\r\n**Bug fixes**\r\n\r\n- Fixed `EuiPopover` to correctly inherit from `EuiProvider`'s\r\n`componentDefaults.EuiPortal.insert`\r\n([#8003](https://github.com/elastic/eui/pull/8003))\r\n- Fixed push `EuiFlyoutResizable`s to not potentially block scrollbars\r\non outside content ([#8010](https://github.com/elastic/eui/pull/8010))\r\n- Fixed an `EuiDataGrid` bug where the `setCellProps` callback passed by\r\n`renderCellValue` was not correctly applying custom `data-test-subj`s\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n\r\n**Accessibility**\r\n\r\n- Updated the `EuiBasicTable` actions button's `aria-label` by adding a\r\nreference to the current row\r\n([#7994](https://github.com/elastic/eui/pull/7994))\r\n\r\n**CSS-in-JS conversions**\r\n\r\n- Converted `EuiDataGrid`'s toolbar controls to Emotion\r\n([#7997](https://github.com/elastic/eui/pull/7997))\r\n - Removed `$euiDataGridPopoverMaxHeight`\r\n- Converted `EuiDataGrid` to Emotion\r\n([#7998](https://github.com/elastic/eui/pull/7998))\r\n - Removed `$euiZDataGrid`\r\n - Removed `$euiZHeaderBelowDataGrid`\r\n- Converted `EuiDataGrid`'s `gridStyle`s to Emotion; Removed the\r\nfollowing Sass variables and mixins:\r\n([#8006](https://github.com/elastic/eui/pull/8006))\r\n - `$euiDataGridCellPaddingS`\r\n - `$euiDataGridCellPaddingM`\r\n - `$euiDataGridCellPaddingL`\r\n - `$euiDataGridVerticalBorder`\r\n - `$euiDataGridPrefix`\r\n - `$euiDataGridStyles`\r\n - `@euiDataGridSelector`\r\n - `@euiDataGridStyles`\r\n- Converted `EuiDataGrid`'s cell popover, actions, and focus outline to\r\nEmotion; Removed the following Sass variables and mixins:\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n - `$euiZDataGridCellPopover`\r\n - `@euiDataGridCellFocus`\r\n- Converted `EuiDataGrid`'s row, header, and footer cells to Emotion;\r\nRemoved the following Sass variables and mixins:\r\n([#8013](https://github.com/elastic/eui/pull/8013))\r\n - `$euiDataGridColumnResizerWidth`\r\n - `@euiDataGridRowCell`\r\n - `@euiDataGridHeaderCell`\r\n - `@euiDataGridFooterCell`","sha":"9bbb296078ea385561d46819001644cdb4fdc714","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","EUI","v9.0.0","ci:project-deploy-observability","Team:obs-ux-management","v8.16.0","backport:version"],"title":"Upgrade EUI to v95.11.0","number":192756,"url":"https://github.com/elastic/kibana/pull/192756","mergeCommit":{"message":"Upgrade EUI to v95.11.0 (#192756)\n\n`v95.10.1`⏩`v95.11.0`\r\n\r\n> [!note]\r\n> The bulk of this release is **EuiDataGrid**. The component has been\r\nfully converted to Emotion, and several UX changes have been made to\r\ndata cell actions. We recommend QA testing any data grid(s) that have\r\ncustom styles applied to them.\r\n\r\n_[Questions? Please see our Kibana upgrade\r\nFAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_\r\n\r\n---\r\n\r\n## [`v95.11.0`](https://github.com/elastic/eui/releases/v95.11.0)\r\n\r\n- Updated `EuiText`, `EuiTextColor`, and `EuiTextAlign` with a new\r\n`component` prop that allows changing the default rendered `<div>`\r\nwrapper to a `<span>` or `<p>` tag.\r\n([#7993](https://github.com/elastic/eui/pull/7993))\r\n- Updated `EuiDataGrid`'s cell actions to always consistently be\r\nleft-aligned, regardless of text content alignment\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n- Increased `EuiDataGrid`'s cell actions hover zone to reduce UX\r\nfriction when mousing over from the grid cell to its actions\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n\r\n**Bug fixes**\r\n\r\n- Fixed `EuiPopover` to correctly inherit from `EuiProvider`'s\r\n`componentDefaults.EuiPortal.insert`\r\n([#8003](https://github.com/elastic/eui/pull/8003))\r\n- Fixed push `EuiFlyoutResizable`s to not potentially block scrollbars\r\non outside content ([#8010](https://github.com/elastic/eui/pull/8010))\r\n- Fixed an `EuiDataGrid` bug where the `setCellProps` callback passed by\r\n`renderCellValue` was not correctly applying custom `data-test-subj`s\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n\r\n**Accessibility**\r\n\r\n- Updated the `EuiBasicTable` actions button's `aria-label` by adding a\r\nreference to the current row\r\n([#7994](https://github.com/elastic/eui/pull/7994))\r\n\r\n**CSS-in-JS conversions**\r\n\r\n- Converted `EuiDataGrid`'s toolbar controls to Emotion\r\n([#7997](https://github.com/elastic/eui/pull/7997))\r\n - Removed `$euiDataGridPopoverMaxHeight`\r\n- Converted `EuiDataGrid` to Emotion\r\n([#7998](https://github.com/elastic/eui/pull/7998))\r\n - Removed `$euiZDataGrid`\r\n - Removed `$euiZHeaderBelowDataGrid`\r\n- Converted `EuiDataGrid`'s `gridStyle`s to Emotion; Removed the\r\nfollowing Sass variables and mixins:\r\n([#8006](https://github.com/elastic/eui/pull/8006))\r\n - `$euiDataGridCellPaddingS`\r\n - `$euiDataGridCellPaddingM`\r\n - `$euiDataGridCellPaddingL`\r\n - `$euiDataGridVerticalBorder`\r\n - `$euiDataGridPrefix`\r\n - `$euiDataGridStyles`\r\n - `@euiDataGridSelector`\r\n - `@euiDataGridStyles`\r\n- Converted `EuiDataGrid`'s cell popover, actions, and focus outline to\r\nEmotion; Removed the following Sass variables and mixins:\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n - `$euiZDataGridCellPopover`\r\n - `@euiDataGridCellFocus`\r\n- Converted `EuiDataGrid`'s row, header, and footer cells to Emotion;\r\nRemoved the following Sass variables and mixins:\r\n([#8013](https://github.com/elastic/eui/pull/8013))\r\n - `$euiDataGridColumnResizerWidth`\r\n - `@euiDataGridRowCell`\r\n - `@euiDataGridHeaderCell`\r\n - `@euiDataGridFooterCell`","sha":"9bbb296078ea385561d46819001644cdb4fdc714"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192756","number":192756,"mergeCommit":{"message":"Upgrade EUI to v95.11.0 (#192756)\n\n`v95.10.1`⏩`v95.11.0`\r\n\r\n> [!note]\r\n> The bulk of this release is **EuiDataGrid**. The component has been\r\nfully converted to Emotion, and several UX changes have been made to\r\ndata cell actions. We recommend QA testing any data grid(s) that have\r\ncustom styles applied to them.\r\n\r\n_[Questions? Please see our Kibana upgrade\r\nFAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_\r\n\r\n---\r\n\r\n## [`v95.11.0`](https://github.com/elastic/eui/releases/v95.11.0)\r\n\r\n- Updated `EuiText`, `EuiTextColor`, and `EuiTextAlign` with a new\r\n`component` prop that allows changing the default rendered `<div>`\r\nwrapper to a `<span>` or `<p>` tag.\r\n([#7993](https://github.com/elastic/eui/pull/7993))\r\n- Updated `EuiDataGrid`'s cell actions to always consistently be\r\nleft-aligned, regardless of text content alignment\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n- Increased `EuiDataGrid`'s cell actions hover zone to reduce UX\r\nfriction when mousing over from the grid cell to its actions\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n\r\n**Bug fixes**\r\n\r\n- Fixed `EuiPopover` to correctly inherit from `EuiProvider`'s\r\n`componentDefaults.EuiPortal.insert`\r\n([#8003](https://github.com/elastic/eui/pull/8003))\r\n- Fixed push `EuiFlyoutResizable`s to not potentially block scrollbars\r\non outside content ([#8010](https://github.com/elastic/eui/pull/8010))\r\n- Fixed an `EuiDataGrid` bug where the `setCellProps` callback passed by\r\n`renderCellValue` was not correctly applying custom `data-test-subj`s\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n\r\n**Accessibility**\r\n\r\n- Updated the `EuiBasicTable` actions button's `aria-label` by adding a\r\nreference to the current row\r\n([#7994](https://github.com/elastic/eui/pull/7994))\r\n\r\n**CSS-in-JS conversions**\r\n\r\n- Converted `EuiDataGrid`'s toolbar controls to Emotion\r\n([#7997](https://github.com/elastic/eui/pull/7997))\r\n - Removed `$euiDataGridPopoverMaxHeight`\r\n- Converted `EuiDataGrid` to Emotion\r\n([#7998](https://github.com/elastic/eui/pull/7998))\r\n - Removed `$euiZDataGrid`\r\n - Removed `$euiZHeaderBelowDataGrid`\r\n- Converted `EuiDataGrid`'s `gridStyle`s to Emotion; Removed the\r\nfollowing Sass variables and mixins:\r\n([#8006](https://github.com/elastic/eui/pull/8006))\r\n - `$euiDataGridCellPaddingS`\r\n - `$euiDataGridCellPaddingM`\r\n - `$euiDataGridCellPaddingL`\r\n - `$euiDataGridVerticalBorder`\r\n - `$euiDataGridPrefix`\r\n - `$euiDataGridStyles`\r\n - `@euiDataGridSelector`\r\n - `@euiDataGridStyles`\r\n- Converted `EuiDataGrid`'s cell popover, actions, and focus outline to\r\nEmotion; Removed the following Sass variables and mixins:\r\n([#8011](https://github.com/elastic/eui/pull/8011))\r\n - `$euiZDataGridCellPopover`\r\n - `@euiDataGridCellFocus`\r\n- Converted `EuiDataGrid`'s row, header, and footer cells to Emotion;\r\nRemoved the following Sass variables and mixins:\r\n([#8013](https://github.com/elastic/eui/pull/8013))\r\n - `$euiDataGridColumnResizerWidth`\r\n - `@euiDataGridRowCell`\r\n - `@euiDataGridHeaderCell`\r\n - `@euiDataGridFooterCell`","sha":"9bbb296078ea385561d46819001644cdb4fdc714"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: Cee Chen <[email protected]> Co-authored-by: Cee Chen <[email protected]>
Summary
Part of #6394
This PR looks intimidating in terms of file diff, but I promise the majority of it is just Storybooks! As such I strongly recommend following along by commit. The TL;DR of changes:
gridStyle
to Emotion (rows, borders, and cell density)stories.utils.tsx
file as a way to generate fake 'components' that would fool Storybook's react docgen, as well as to share a stateful datagrid:QA
General checklist
- [ ] Checked in mobile- [ ] Checked for accessibility including keyboard-only and screenreader modes@default
if default values are missing)- [ ] Checked Code Sandbox works for any docs examplesand cypress tests- [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)